# -*- coding: utf-8 -*-
"""
@ Created on 2024-06-14 12:23
---------
@summary: 字典类型表单模型
---------
@author: Lsaiah
"""

from pydantic import BaseModel, Field
from typing import Optional


class DictTypeCreateRequest(BaseModel):
    """字典类型创建请求"""
    name: str = Field(..., description="字典类型名称", max_length=100)
    code: str = Field(..., description="字典类型编码", max_length=50)
    description: Optional[str] = Field(None, description="字典类型描述", max_length=200)
    is_active: bool = Field(True, description="是否激活")
    sort_order: int = Field(0, description="排序")


class DictTypeUpdateRequest(BaseModel):
    """字典类型更新请求"""
    id: int = Field(..., description="字典类型ID")
    name: Optional[str] = Field(None, description="字典类型名称", max_length=100)
    code: Optional[str] = Field(None, description="字典类型编码", max_length=50)
    description: Optional[str] = Field(None, description="字典类型描述", max_length=200)
    is_active: Optional[bool] = Field(None, description="是否激活")
    sort_order: Optional[int] = Field(None, description="排序")
